home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Multiprocessing 2.1v2 SDK / Sample Code / PowerFrax / PowerFrax Read Me Part 2 < prev    next >
Encoding:
Text File  |  1999-11-17  |  5.9 KB  |  81 lines  |  [ttro/ttxt]

  1.  
  2.            PowerFrax For Multiprocessing API Library SDK
  3.  
  4.                                                                                                                                                                                                                             March 12, 1998
  5.  
  6. PowerFrax is a fractal generator used to demonstrate DayStar's accelerators and multiprocessing systems. The version that is included in this SDK takes advantage of the Multiprocessing API Library. Source code has been provided that demonstrates how this is achieved.
  7.  
  8. This document describes the components of PowerFrax, how PowerFrax works, how to build PowerFrax and how to debug it. For specific implementation details refer to the comments within the source code itself.
  9.  
  10. PowerFrax Components
  11.  
  12. PowerFraxMP.π CW P3
  13. This Metrowerks PPC project builds a PPC code resource directly into the "PowerFrax" application. This is the module that implements all of the multiprocessing facilities. Note that the Multiprocessing API Library is 'weak-linked' into this project. Any application that does not require the library to be present should weak link to the library. The Mac OS will refuse to launch any program that strong links to a shared library that cannot be located.
  14.  
  15. MandelbrotPPCMod.π CW P3
  16. This Metrowerks PPC project builds a PPC code resource directly into the "PowerFrax" application. This is the module that implements the Mandelbrot algorithm. This project is provided as a reference. It is not really necessary to understand the multiprocessing example.
  17.  
  18. sources
  19. This folder contains the source files used by the projects.
  20.  
  21. "HFMultiprocessingPPC.c" is part of the "PowerFraxMP.π CW P3" project. It contains the functions that PowerFrax uses for task creation, communication and destruction. It also contains the single function used for the tasks.
  22.  
  23. "PowerFraxMP.π.exp" is part of the "PowerFraxMP.π CW P3" project. It lists the symbols exported from the module to PowerFrax.
  24.  
  25. "HFDocMandelbrot.c" is part of the "MandelbrotPPCMod.π CW P3" project. It contains a generic Mandelbrot fractal generation routine
  26.  
  27. "HFDocMandelbrot.o" is a highly optimized compiled version of "HFDocMandelbrot.c". It was compiled using the Motorola compiler which for this particular piece of code proved to be significantly better than anything else. For better performance in PowerFrax include this file directly in the "MandelbrotPPCMod.π CW P3" project, remove the file "HFDocMandelbrot.c" and recompile. The version of PowerFrax in the SDK was built using this optimised file.
  28.  
  29. includes
  30. This folder contains the include files used by the projects.
  31.  
  32. "HFDocMandelbrot.h" is part of the "MandelbrotPPCMod.π CW P3" project. It defines the parameter block used by the Mandelbrot function.
  33.  
  34. PowerFrax
  35. The main PowerFrax application. "PowerFraxMP.π CW P3" and "MandelbrotPPCMod.π CW P3" both build directly into this file.
  36.  
  37. 3D Projection
  38. A PowerFrax plug-in that will generate 3D projections of fractals. QD3D and a PowerPC Macintosh are required to use this plug-in. 3D projections may not be available under some versions of QD3D.
  39.  
  40. Julia Sets
  41. A PowerFrax plug-in that will generate Julia sets.
  42.  
  43. Fractals
  44. Some cool fractals.
  45.  
  46. PowerFrax Read Me
  47. The read me that went out with the release version of PowerFrax.
  48.  
  49.  
  50. How PowerFrax Works
  51.  
  52. PowerFrax is a 68k application that uses PPC code fragments for multiprocessor support and for fractal generation. When PowerFrax starts it initializes multiprocessing by calling fMPInitialize() inside the PowerFraxMP module built by "PowerFraxMP.π CW P3". To create the required tasks fMPTasksCreate() is called. When PowerFrax is through with the tasks it calls fMPTasksQuit(). PowerFrax generates fractals one scanline at time. It submits one scanline to each of the tasks currently available by calling fMPTaskRun() for each task. It then waits for each task to finish by calling fMPTaskWait(). This process is repeated until the fractal is finished.
  53.  
  54. The number of tasks available to PowerFrax can be controlled via the Multiprocessing menu. A multi-processor environment can be simulated by pressing command-d. The contents of the Multiprocessing menu will convert to 'DayStar' mode. Select the 'Other...' item and type in a number from 1 to 100. That many tasks will be created and used to regenerate all the open fractals.
  55.  
  56. Since PowerFrax can support plugin based fractal generators the PowerFraxMP module allows an arbitrary fractal generating function to be specified. Thus when examining the task code inside "HFMultiprocessingPPC.c" no reference to a specific fractal generator will be found. The statement
  57.  
  58.                 p->workFunction( p->params );
  59.  
  60. is the call to the function that generates the fractal data. Parameters passed to the function fMPTaskRun() define which function will be used and what parameters will be used prior to signaling the task to run. Note that the parameters referred to by tasks are unique blocks of data. If a shared block were used then the tasks would all generate the same information.
  61.  
  62. The project "MandelbrotPPCMod.π CW P3" creates the Mandelbrot fractal generating module. The one and only function inside this project is the one called by fTask() using the above statement. There is a similar function inside the Julia Sets plug-in.
  63.  
  64.  
  65. Building And Debugging PowerFrax
  66.  
  67. PowerFrax comes pre-built. It is not necessary to recompile anything unless you want to experiment with debugging.
  68.  
  69. CodeWarrior Pro 3:
  70.  
  71. Open "PowerFraxMP.π CW P3" and select "Enable Debugger" from the "Project" menu followed by "Debug" from the "Project" menu. The multi-processing module will be built directly into the PowerFrax application, PowerFrax will be launched and the integrated debugger will be activated.
  72.  
  73. Multiprocessing Support
  74.  
  75. Please see the last entry in "MP API FAQs" for support information.
  76.  
  77.     Historical note: PowerFrax' first name was HappyFracs; a name which lasted about two days, i.e. the interval between starting it and Monday morning, when Marketing first saw it. Although the product's name has changed, most of the naming conventions used in the project are still based on the earlier name.
  78.  
  79.  
  80. Copyright © DayStar Digital, Inc. 1995-1998
  81.